﻿#ifndef COMMANDMANAGERPY_H
#define COMMANDMANAGERPY_H

#include <QObject>
#include "API_CommandManager.h"

#define CommandManagerPyInstance CommandManager::CommandManagerPy::getInstance()

namespace CommandManager
{
    // 封装C++功能，供C接口调用
    class API_COMMANDMANAGER CommandManagerPy : public QObject
    {
        Q_OBJECT
    public:
        /// @brief 获取单例
        static CommandManagerPy* getInstance();

    private:
        CommandManagerPy();
        /// @brief 初始化链接信号槽
        void initConnect();

        void putErrorMsg(QString content);

    signals:
        void signal_smartScriptSave(QString fileName);
        void signal_smartScriptRun(QString fileName, bool isNoGui, QString listPara);
        void signal_smartScriptEdit(QString fileName, QString text);

        void signal_projectTreeSelectionChanged(QString projectTreeSelctedRowIDListStr);
        void signal_saveGraph(QString filePath);
        void signal_dataImport(QString filePath, bool isTextOrCsv, QString customData);

        // 热力图
        void signal_createTwoDLineChart(int lineChartType, int variableIndex, QList<QPair<int, QList<int>>> chosenkeyList, QList<int> valueIndexs, QList<int> selectParserIndex, bool isOpenNewWindow);
        void signal_setHeatMapSelectedCurveNameIndexs(int windowId, QList<int> selectedCurveNameIndexs);
        void signal_setHeatMapVariableAxisChanged(int windowId, int variableAxisIndex);
        void signal_setHeatMapSecondVariableAxisChanged(int windowId, int variableAxisIndex);
        void signal_setHeatMapCurveNameCheckStateChanged(int windowId, int curveNameIndex, bool checkState);
        void signal_setHeatMapDataOprationChanged(int windowId, bool isLoged, bool isNormalized);
        void signal_setHeatMapResultValueDataChanged(int windowId, int valueId);
        void signal_saveHeatMapMainSettingData(int windowId, bool scalarBarIsAutoRange, double scalarBarMin, double scalarBarMax,
                                               QString scalarBarColor, int scalarBarFontSize, bool XAxisAutoTitle, QString XAxisTitle, QString XTitleFontColor, int XTitleFontSize,
                                               QString XAxisColor, double XAisThickness, int XValuePrecision, QString XAxisDigitColor, int XAxisDigitSize,
                                               bool XAxisIsAutoRange, double XAxisMax, double XAxisMin, bool XIsAutoStepSize, double XCustomStepSize,
                                               bool YAxisAutoTitle, QString YAxisTitle, QString YTitleFontColor, int YTitleFontSize,
                                               QString YAxisColor, double YAisThickness, int YValuePrecision, QString YAxisDigitColor, int YAxisDigitSize,
                                               bool YAxisIsAutoRange, double YAxisMax, double YAxisMin, bool YIsAutoStepSize, double YCustomStepSize,
                                               bool gridIsMainGridLineDisplay, QString gridMainGridLineColor, int gridMainGridLineStyle, double gridMainGridLineThickness,
                                               bool gridIsSecondaryGridLineDisplay, QString gridSecondaryGridLineColor, int gridSecondaryGridLineStyle, double gridSecondaryGridLineThickness,
                                               QString windowTitleName, QString windowTitleFontColor, int windowTitleFontSize);
        void signal_setHeatMapFixedValueChanged(int windowId, QList<int> indexList);
        void signal_setHeatMapComplexPartsChanged(int windowId, bool isAmplitudeChecked, bool isPhaseChecked, bool isRealPartChecked, bool isImaginaryPartChecked);
        void signal_setHeatMapRemoveSelectedGraph(int windowId);
        void signal_setHeatMapRenameFinished(int windowId, QString name);
        void signal_setHeatMapAddTracer(int windowId, QString name, double x, double y, double value, int tracerStyle, int size, int penR, int penG, int penB, int penA, int interpolating, int curveInfoID, int tracerIndex);
        void signal_setHeatMapRemoveSelectedTracer(int windowId, QList<int> infoIdList);
        void signal_setHeatMapRemoveAllTracer(int windowId, QList<int> infoIdList);
        void signal_setHeatMapExportMarkerData(int windowId, QString fileName);
        void signal_setHeatMapChangeTracerProperty(int windowId, QString name, int symbolStyle, int size, int penR, int penG, int penB, int penA, int tracerID);

        // 二维折线图
        void signal_lineChartSidebarVariableAxisChanged(int mainWindowId, QList<int> allSelectedItem, int reuslt, QString sVariableAxistCurrentText);
        void signal_lineChartSidebarCurveNameClicked(int mainWindowId, QList<int> sselectedIndexes);
        void signal_lineChartSidebarCurveNameCheckStateChanged(int mainWindowId, int index, int checkStatus);
        void signal_lineChartSidebarFixedValueChanged(int mainWindowId, QList<int> allIndexList);
        void signal_lineChartSidebarDataOperationChanged(int mainWindowId, bool isNormChecked, bool isDBChecked, bool isMathOperationChecked);
        void signal_lineChartSidebarValueDataChanged(int mainWindowId, int currentIndex);
        void signal_saveLineChartMainSettingData(int mainWindowId, int index, bool axiDisIsAutoName, QString axiDisTitleText, QString axiDisTitleFontColorStr, int axiDisTitleFontSize, QString axiDisAxisColorStr, int axiDisAxisThickness, double axiDisValuePrecision, QString axiDisAxisDigitColorStr, int axiDisAxisDigitSize,
                                                 bool axiRangIsAutoRange, double axiRangMaxValue, double axiRangMinValue, bool axiRangIsAutoStepSize, double axiRangCustomStepSize,
                                                 bool yAxiDisIsAutoName, QString yAxiDisTitleText, QString yAxiDisTitleFontColorStr, int yAxiDisTitleFontSize, QString yAxiDisAxisColorStr, int yAxiDisAxisThickness, double yAxiDisValuePrecision, QString yAxiDisAxisDigitColorStr, int yAxiDisAxisDigitSize,
                                                 bool yAxiRangIsAutoRange, double yAxiRangMaxValue, double yAxiRangMinValue, bool yAxiRangIsAutoStepSize, double yAxiRangCustomStepSize,
                                                 bool gridIsMainGridLineDisplay, QString gridMainGridLineColorStr, int gridMainGridLineStyle, double gridMainGridLineThickness, bool gridIsSecondaryGridLineDisplay, QString gridSecondaryGridLineColorStr, int gridSecondaryGridLineStyle, double gridSecondaryGridLineThickness,
                                                 QString titleName, QString titleFontColorStr, int titleFontSize,
                                                 QString legendFontColorStr, int legendFontSize, QString legendLineColorStr, int legendLineThickness,
                                                 QString resultDataName, QString dataLineColorStr, int dataLineStyle, double dataLineThickness, bool isDisplaySymbol, int symbolStyle, double symbolSize, QString symbolColorStr);

        // 极坐标图
        void signal_polarCoordinateGraphSidebarVariableAxisChanged(int mainWindowId, QList<int> allSelectedItem, int reuslt, QString sVariableAxistCurrentText);
        void signal_polarCoordinateGraphSidebarAllVariableAxisChanged(int mainWindowId, QString sVariableAxistCurrentText);
        void signal_polarCoordinateGraphSidebarCurveNameClicked(int mainWindowId, QList<int> sselectedIndexes);
        void signal_polarCoordinateGraphSidebarCurveNameCheckStateChanged(int mainWindowId, int index, int checkStatus);
        void signal_polarCoordinateGraphSidebarDataOperationChanged(int mainWindowId, bool isNormChecked, bool isDBChecked);
        void signal_polarCoordinateGraphSidebarValueDataChanged(int mainWindowId, int currentIndex);
        void signal_savePolarCoordinateGraphMainSettingData(int mainWindowId, int index, QString angDisAxisColor, int angDisAxisThickness, double angDisValuePrecision, QString angDisAxisDigitColor, int angDisAxisDigitSize,
                                                            bool angRangIsAutoStepSize, double angRangCustomStepSize,
                                                            QString radDisAxisColorStr, int radDisAxisThickness, double radDisValuePrecision, QString radDisAxisDigitColorStr, int radDisAxisDigitSize,
                                                            bool radRangIsAutoRange, double radRangMaxValue, double radRangMinValue, bool radRangIsAutoStepSize, double radRangCustomStepSize,
                                                            bool gridIsMainGridLineDisplay, QString gridMainGridLineColor, int gridMainGridLineStyle, double gridMainGridLineThickness,
                                                            QString titleName, QString titleFontColor, int titleFontSize,
                                                            QString legendFontColor, int legendFontSize, QString legendLineColor, int legendLineThickness,
                                                            QString dataProResultDataName, QString dataProDataLineColor, int dataProDataLineStyle, double dataProDataLineThickness, bool dataProIsDisplaySymbol, int dataProSymbolStyle, double dataProSymbolSize, QString dataProSymbolColor);
        void signal_polarCoordinateGraphSidebarDeleteAllGraph(int mainWindowId);
        void signal_polarCoordinateGraphSidebarRenameSelectedGraph(int mainWindowId, QString name);
        void signal_polarCoordinateGraphSidebarComplexPartsChanged(int windowId, bool isAmplitudeChecked, bool isPhaseChecked, bool isRealPartChecked, bool isImaginaryPartChecked);
        void signal_polarCoordinateGraphSidebarFixedValueChanged(int windowId, QList<int> indexList);
        void signal_polarCoordinateGraphSidebarRemoveSelectedGraph(int windowId, QList<int> indexList);
        void signal_polarCoordinateGraphSidebarCopySelectedGraph(int mainWindowId);
        void signal_polarCoordinateGraphAddTracer(int mainWindowId, QString name, double angle, int tracerStyle, int size, int penR, int penG, int penB, int penA,
                                                  int brushR, int brushG, int brushB, int brushA, int interpolating, int curveInfoID, int tracerIndex);
        void signal_polarCoordinateGraphRemoveSelectedTracer(int windowId, QList<int> infoIdList, int curveInfoID);
        void signal_polarCoordinateGraphRemoveAllTracer(int windowId, QList<int> infoIdList);
        void signal_polarCoordinateGraphExportMarkerData(int windowId, QString fileName);
        void signal_polarCoordinateGraphChangeTracerProperty(int windowId, QString name, double x, int symbolStyle, int size, int penR, int penG, int penB, int penA, int tracerID);

        // 三维曲面图
        void signal_createThreeDSurfacePlot(int graphType, int variableIndex, int frequencyIndex, int readerIndex, QString filePath, QString name, QString geometryFileName, bool isOpenNewWindow);
        void signal_threeDSurfacePlotSidebarCurveNameClicked(int windowId, QList<int> selectedIndexes);
        void signal_threeDSurfacePlotSidebarFrequencyChanged(int windowId, int frequencyId);
        void signal_threeDSurfacePlotSidebarResultDataChanged(int windowId, int resultDataIndex);
        void signal_threeDSurfacePlotSidebarDataOprationChanged(int windowId, bool isLoged, bool isNormalized);
        void signal_threeDSurfacePlotSidebarCurveNameItemCheckStateChanged(int windowId, int itemIndex, bool checkState);
        void signal_saveThreeDSurfacePlotMainSettingData(int windowId, int settingDataId, bool scalarBarIsAutoRange, double scalarBarMin, double scalarBarMax,
                                                         bool scalarBarIsShowTitle, QString scalarBarTitle, QString scalarBarFontColor, int scalarBarFontSize, int geometryTransparency, QString resultGraphName,
                                                         int resultGraphModelTransparency, double resultGraphScale, bool cubeAxesIsVisible);
        void signal_saveThreeDSurfacePlotMoveResultDataSetting(int windowId, int infomationId, double translationX, double translationY, double translationZ,
                                                                           double rotationTheta, double rotationPhi);
        void signal_delete3DSurfacePlots(int windowId, QString selectedIndexs);
        void signal_threeDSurfaceCurveNameItemRename(int windowId, int itemIndex, QString newName);
        void signal_threeDSurfaceCurveDataFileterRadioButtonClicked(int windowId, int index);

        // 三维云图
        void signal_createThreeDCloudMap(bool useNewWindow, int graphType, int variableIndex, int readerIndex, QString filePath, QString name, QString geometryFileName, int resultDataIndex);
        void signal_threeDCloudMapSidebarCurveNameClicked(int windowId, QList<int> selectedIndexes);
        void signal_threeDCloudMapSidebarItemCheckStateChanged(int windowId, int index, bool visible);
        void signal_threeDCloudMapSidebarDataOprationChanged(int windowId, bool isLoged, bool isNormalized);
        void signal_threeDCloudMapSidebarUpdateFixedParameter(int windowId, int index);
        void signal_threeDCloudMapSidebarUpdateOriginalDataSource(int mainWindowId, int index, int showType, int fixedValueIndex, bool isLog, bool isNormalize);
        void signal_threeDCloudMapSidebarResultDataChanged(int windowId, int index);
        void signal_threeDCloudMapSidebarNameItemRename(int windowId, int itemIndex, QString newName);
        void signal_threeDCloudMapSidebarDelete3DCloudMap(int windowId, QString selectedIndexs);
        void signal_saveThreeDCloudMapMainSettingData(int windowId, int type, int settingDataId,
                                                      bool scalarBarIsAutoRange, double scalarBarMin, double scalarBarMax,
                                                      bool scalarBarIsShowTitle, QString scalarBarTitle, QString scalarBarFontColor, int scalarBarFontSize,
                                                      int geometryTransparency, QString resultGraphName, int resultGraphModelTransparency, bool cubeAxesIsVisible);

        // 表面点电场图
        void signal_createSurfaceElectricFieldGraph(int graphType, int currentIndex, int readerIndex, QString sReaderType, QString sFilePath, QString sName, QString geometryFileName, bool isOpenNewWindow);
        void signal_surfaceElectricFieldMapSidebarCurveNameClicked(int windowId, QList<int> selectedIndexes);
        void signal_surfaceElectricFieldMapSidebarItemCheckStateChanged(int windowId, int index, bool visible);
        void signal_surfaceElectricFieldMapSidebarResultDataChanged(int windowId, int index);
        void signal_surfaceElectricFieldMapSidebarUpdateProcessData(int windowId, bool isLog, bool isNormalize);
        void signal_surfaceElectricFieldMapSidebarNameItemRename(int windowId, int itemIndex, QString newName);
        void signal_surfaceElectricFieldMapSidebarDeleteSurfaceElectricFieldMap(int windowId, QString selectedIndexs);
        void signal_saveSurfaceElectricFieldMapMainSettingData(int windowId, int type, int settingDataId,
                                                               bool scalarBarIsAutoRange, double scalarBarMin, double scalarBarMax,
                                                               bool scalarBarIsShowTitle, QString scalarBarTitle, QString scalarBarFontColor, int scalarBarFontSize,
                                                               int geometryTransparency, QString resultGraphName, int resultGraphModelTransparency, bool cubeAxesIsVisible);

        //三维图标记
        void signal_savePostMarkerAddSettingData(int windowUniversalID, int infomationGraph3DBasicalId, int type,
                                                 int fieldIndex, QString fieldName, int pickedId, QString pickedValue);
        void signal_savePostMarkerRemoveChosenSettingData(int windowUniversalID, QString removeChosenId);
        void signal_savePostMarkerRemoveAllSettingData(int windowUniversalID);
        void signal_savePostMarkerExportTableData(int windowUniversalID, QString fileName);

        //模型显示
        void signal_saveModelDisplaySettingData(int windowUniversalID, bool toolButtonActiveClipperIsChecked, bool toolButtonModelDisplayIsChecked, bool hasAnyGeometrySuccess);
        void signal_saveActiveClipperSettingData(int windowUniversalID, bool toolButtonActiveClipperIsChecked, bool toolButtonModelDisplayIsChecked, bool hasAnyGeometrySuccess, QString direction, double clipperValue);

        // 表格数据
        void signal_createTableWidget(int readerIndex);
        void signal_hideOrShowTableColumn(int windowId, QString selectedIndex);
        void signal_changeTbColumnName(int windowId, int index, QString newName);
        void signal_flushTbBySelectedRow(int windowId, QString parms);
        void signal_exportTbData(int windowId, QString filePath, QString delimiter, int onlyVisible);
        void signal_highlightSelectedTbColumns(int windowId, QString parms);

        // 工程数据
        void signal_doPrjFileWrite(QString fileName);
        void signal_doPrjFileRead(QString fileName);

        void signal_doPrjCloseTree(int index);
        void signal_doPrjTreeCopyDir(int index);
        void signal_doPrjTreePasteDir(int srcId, int destId);
        void signal_doPrjTreeCopyData(int index);
        void signal_doPrjTreePasteData(int srcId, int destId);
        void signal_doPrjTreeExpandDir(int index);
        void signal_doPrjTreeCollapseDir(int index);
        void signal_closeCenterTableBar(int index);
        void signal_changeCurrentTabBar(int index);
        void signal_submitEvaluation(int windowId, int emulationType, QString parms);

        void signal_openProject();
        
        void signal_importProjectData(QString data);

        void signal_lineChartWindowSetIsEdit(bool state);
        void signal_lineChartChangeLineProperty(int windowUniversalID, int curveInfoID, QString docStr);
        void signal_centerWidgetTabWidgetCurrentChanged(int currentIndex);
        void signal_lineChartCurve2DPlotorGuideLineSelectRemove();
        void signal_lineChartCurve2DPlotorGuideLineAllRemove();
        void signal_lineChartCurve2DPlotorMarkerSelectRemove();
        void signal_lineChartCurve2DPlotorMarkerAllRemove();
        void signal_lineChartLineChartTracerSelectChange(int id, bool selected);
        void signal_lineChartLineChartStraightLineSelectChange(int id, bool selected);
        void signal_lineChartWindowChangeGuideLineProperty(int guideLineID, double value, int guideLineStyle, double guideLineThickness, QString guideLineColor);
        void signal_lineChartWindowChangeTracerProperty(int tracerID, QString tracerName, double x, int symbolStyle, double symbolSize, QString symbolColor);
        void signal_lineChartAxisLineUpdate(QString typeAxis, int id, double value);
        void signal_lineChartComputeHIRF(const QString& graphNames, double incidentWaveFieldValue, const QString& HIRFName, const QString& typeName, bool isCheckBoxChecked);
        void signal_lineChartSidebarSettingsRemoveSelectedGraph();
        void signal_lineChartSidebarSettingsDeleteAllCurve();
        void signal_lineChartCreateLineChartStraightLine(int typeAxis);
        void signal_lineChartMeasureButtonClicked(int meaureTypeInt, double value);
        void signal_lineChartSidebarSettingsRenameCheck(QString text);
        void signal_lineChartDialogCurveSmoothing(double range);
        void signal_lineChartCenterWidgetMoveLegend(int dataInt);
        void signal_lineChartWindowAddTracer(int windowUniversalID, QString parameters);
        void signal_lineChartCenterWidgetDialogAddLocalRange(double rangeLower, double rangeUpper, QString selectNames, bool execFlag, bool edit);
        void signal_lineChartCurve2DPlotorRemoveSelectedGraph();
        void signal_lineChartCurve2DPlotorRemoveAllGraphs();
        void signal_lineChartDialogWaveformAnalysis(QString graphName, double cutOffFrequency, QString filterType, int filterOrder, double leftBoundary, double rightBoundary,int windowId, QString resultList);
        void signal_lineChartDialogIPLCalculation(QString IPLString);
        void signal_lineChartDialogTransferFunction(QString graphName, QString calibrationGraphName, QString type);
        void signal_lineChartCenterWidgetInfoListPaste(QString infoIds);
        void signal_lineChartSidebarSettingsAllVariableAxisSet(QString variableAxisName);
        void signal_lineChartSidebarSettingsComplex(QString(data));
        void signal_lineChartSidebarSettingsFormulaEditor(QString(data));
        void signal_lineChartSidebarSettingsCopySelectedGraph();
        void signal_lineChartComputeEffectiveness(QString graphNames, double e0);
        void signal_lineChartDialogInterpolation(int number, int type);

        void signal_exportPstData(QString filePath);

        void signal_sentWaveButterANdFFTVResult(int windowId, QString resultList);

    public slots:
        void slot_undo();
        void slot_redo();

    private:
        static CommandManagerPy* m_instance;
    };

} // namespace CommandManager

// 声明为C接口，供Python脚本调用
extern "C"
{
    API_COMMANDMANAGER void undo();
    API_COMMANDMANAGER void redo();
    API_COMMANDMANAGER void smartScriptSave(char* fileName);
    API_COMMANDMANAGER void smartScriptRun(char* fileName, bool isNoGui, char* listPara);
    API_COMMANDMANAGER void smartScriptEdit(char* fileName, char* text);
    API_COMMANDMANAGER void projectTreeSelectionChanged(char* projectTreeSelctedRowIDListStr);
    API_COMMANDMANAGER void saveGraph(char* filePath);
    API_COMMANDMANAGER void dataImport(char* filePath, bool isTextOrCsv, char* customData);

    // 热力图
    API_COMMANDMANAGER void createTwoDLineChart(int lineChartType, int variableIndex, char* chosenkeyList, char* valueIndexs, char* selectParserIndex,bool isOpenNewWindow);
    API_COMMANDMANAGER void setHeatMapSelectedCurveNameIndexs(int windowId, char* selectedCurveNameIndexs);
    API_COMMANDMANAGER void setHeatMapVariableAxisChanged(int windowId, int variableAxisIndex);
    API_COMMANDMANAGER void setHeatMapSecondVariableAxisChanged(int windowId, int variableAxisIndex);
    API_COMMANDMANAGER void setHeatMapCurveNameCheckStateChanged(int windowId, int curveNameIndex, bool checkState);
    API_COMMANDMANAGER void setHeatMapDataOprationChanged(int windowId, bool isLoged, bool isNormalized);
    API_COMMANDMANAGER void setHeatMapResultValueDataChanged(int windowId, int resultValueIndex);
    API_COMMANDMANAGER void saveHeatMapMainSettingData(int windowId, bool scalarBarIsAutoRange, double scalarBarMin, double scalarBarMax,
                                                       char* scalarBarColor, int scalarBarFontSize, bool XAxisAutoTitle, char* XAxisTitle, char* XTitleFontColor, int XTitleFontSize,
                                                       char* XAxisColor, double XAisThickness, int XValuePrecision, char* XAxisDigitColor, int XAxisDigitSize,
                                                       bool XAxisIsAutoRange, double XAxisMax, double XAxisMin, bool XIsAutoStepSize, double XCustomStepSize,
                                                       bool YAxisAutoTitle, char* YAxisTitle, char* YTitleFontColor, int YTitleFontSize,
                                                       char* YAxisColor, double YAisThickness, int YValuePrecision, char* YAxisDigitColor, int YAxisDigitSize,
                                                       bool YAxisIsAutoRange, double YAxisMax, double YAxisMin, bool YIsAutoStepSize, double YCustomStepSize,
                                                       bool gridIsMainGridLineDisplay, char* gridMainGridLineColor, int gridMainGridLineStyle, double gridMainGridLineThickness,
                                                       bool gridIsSecondaryGridLineDisplay, char* gridSecondaryGridLineColor, int gridSecondaryGridLineStyle, double gridSecondaryGridLineThickness,
                                                       char* windowTitleName, char* windowTitleFontColor, int windowTitleFontSize);
    API_COMMANDMANAGER void setHeatMapFixedValueChanged(int windowId, char* indexList);
    API_COMMANDMANAGER void setHeatMapComplexPartsChanged(int windowId, bool isAmplitudeChecked, bool isPhaseChecked, bool isRealPartChecked, bool isImaginaryPartChecked);
    API_COMMANDMANAGER void setHeatMapRemoveSelectedGraph(int windowId);
    API_COMMANDMANAGER void setHeatMapRenameFinished(int windowId, char* name);
    API_COMMANDMANAGER void setHeatMapAddTracer(int windowId, char* name, double x, double y, double value, int tracerStyle, int size, int penR, int penG, int penB, int penA, int interpolating, int curveInfoID, int tracerIndex);
    API_COMMANDMANAGER void setHeatMapRemoveSelectedTracer(int windowId, char* sinfoIdList);
    API_COMMANDMANAGER void setHeatMapRemoveAllTracer(int windowId, char* sinfoIdList);
    API_COMMANDMANAGER void setHeatMapExportMarkerData(int windowId, char* fileName);
    API_COMMANDMANAGER void setHeatMapChangeTracerProperty(int windowId, char* name, int symbolStyle, int size, int penR, int penG, int penB, int penA, int tracerID);

    // 二维折线图
    API_COMMANDMANAGER void lineChartSidebarVariableAxisChanged(int mainWindowId, char* sAllSelectedItemStr, int reuslt, char* sVariableAxistCurrentText);
    API_COMMANDMANAGER void lineChartSidebarCurveNameClicked(int mainWindowId, char* sselectedIndexes);
    API_COMMANDMANAGER void lineChartSidebarCurveNameCheckStateChanged(int mainWindowId, int index, int checkStatus);
    API_COMMANDMANAGER void lineChartSidebarFixedValueChanged(int mainWindowId, char* sAllIndexList);
    API_COMMANDMANAGER void lineChartSidebarDataOperationChanged(int mainWindowId, bool isNormChecked, bool isDBChecked, bool isMathOperationChecked);
    API_COMMANDMANAGER void lineChartSidebarValueDataChanged(int mainWindowId, int currentIndex);
    API_COMMANDMANAGER void lineChartSidebarValueDataChanged(int mainWindowId, int currentIndex);
    API_COMMANDMANAGER void saveLineChartMainSettingData(int mainWindowId, int index, bool axiDisIsAutoName, char* axiDisTitleText, char* axiDisTitleFontColorStr, int axiDisTitleFontSize, char* axiDisAxisColorStr, int axiDisAxisThickness, double axiDisValuePrecision, char* axiDisAxisDigitColorStr, int axiDisAxisDigitSize,
                                                         bool axiRangIsAutoRange, double axiRangMaxValue, double axiRangMinValue, bool axiRangIsAutoStepSize, double axiRangCustomStepSize,
                                                         bool yAxiDisIsAutoName, char* yAxiDisTitleText, char* yAxiDisTitleFontColorStr, int yAxiDisTitleFontSize, char* yAxiDisAxisColorStr, int yAxiDisAxisThickness, double yAxiDisValuePrecision, char* yAxiDisAxisDigitColorStr, int yAxiDisAxisDigitSize,
                                                         bool yAxiRangIsAutoRange, double yAxiRangMaxValue, double yAxiRangMinValue, bool yAxiRangIsAutoStepSize, double yAxiRangCustomStepSize,
                                                         bool gridIsMainGridLineDisplay, char* gridMainGridLineColorStr, int gridMainGridLineStyle, double gridMainGridLineThickness, bool gridIsSecondaryGridLineDisplay, char* gridSecondaryGridLineColorStr, int gridSecondaryGridLineStyle, double gridSecondaryGridLineThickness,
                                                         char* titleName, char* titleFontColorStr, int titleFontSize,
                                                         char* legendFontColorStr, int legendFontSize, char* legendLineColorStr, int legendLineThickness,
                                                         char* resultDataName, char* dataLineColorStr, int dataLineStyle, double dataLineThickness, bool isDisplaySymbol, int symbolStyle, double symbolSize, char* symbolColorStr);

    // 极坐标图
    API_COMMANDMANAGER void polarCoordinateGraphSidebarVariableAxisChanged(int mainWindowId, char* sAllSelectedItemStr, int reuslt, char* sVariableAxistCurrentText);
    API_COMMANDMANAGER void polarCoordinateGraphSidebarAllVariableAxisChanged(int mainWindowId, char* sVariableAxistCurrentText);
    API_COMMANDMANAGER void polarCoordinateGraphSidebarCurveNameClicked(int mainWindowId, char* sselectedIndexes);
    API_COMMANDMANAGER void polarCoordinateGraphSidebarCurveNameCheckStateChanged(int mainWindowId, int index, int checkStatus);
    API_COMMANDMANAGER void polarCoordinateGraphSidebarDataOperationChanged(int mainWindowId, bool isNormChecked, bool isDBChecked);
    API_COMMANDMANAGER void polarCoordinateGraphSidebarValueDataChanged(int mainWindowId, int currentIndex);
    API_COMMANDMANAGER void savePolarCoordinateGraphMainSettingData(int mainWindowId, int index, char* angDisAxisColor, int angDisAxisThickness, double angDisValuePrecision, char* angDisAxisDigitColor, int angDisAxisDigitSize,
                                                                    bool angRangIsAutoStepSize, double angRangCustomStepSize,
                                                                    char* radDisAxisColorStr, int radDisAxisThickness, double radDisValuePrecision, char* radDisAxisDigitColorStr, int radDisAxisDigitSize,
                                                                    bool radRangIsAutoRange, double radRangMaxValue, double radRangMinValue, bool radRangIsAutoStepSize, double radRangCustomStepSize,
                                                                    bool gridIsMainGridLineDisplay, char* gridMainGridLineColor, int gridMainGridLineStyle, double gridMainGridLineThickness,
                                                                    char* titleName, char* titleFontColor, int titleFontSize,
                                                                    char* legendFontColor, int legendFontSize, char* legendLineColor, int legendLineThickness,
                                                                    char* dataProResultDataName, char* dataProDataLineColor, int dataProDataLineStyle, double dataProDataLineThickness, bool dataProIsDisplaySymbol, int dataProSymbolStyle, double dataProSymbolSize, char* dataProSymbolColor);
    API_COMMANDMANAGER void polarCoordinateGraphSidebarDeleteAllGraph(int mainWindowId);
    API_COMMANDMANAGER void polarCoordinateGraphSidebarRenameSelectedGraph(int mainWindowId, char* name);
    API_COMMANDMANAGER void polarCoordinateGraphSidebarComplexPartsChanged(int windowId, bool isAmplitudeChecked, bool isPhaseChecked, bool isRealPartChecked, bool isImaginaryPartChecked);
    API_COMMANDMANAGER void polarCoordinateGraphSidebarFixedValueChanged(int windowId, char* indexList);
    API_COMMANDMANAGER void polarCoordinateGraphSidebarRemoveSelectedGraph(int windowId, char* indexList);
    API_COMMANDMANAGER void polarCoordinateGraphSidebarCopySelectedGraph(int mainWindowId);
    API_COMMANDMANAGER void polarCoordinateGraphAddTracer(int mainWindowId, char* name, double angle, int tracerStyle, int size, int penR, int penG, int penB, int penA,
                                                          int brushR, int brushG, int brushB, int brushA, int interpolating, int curveInfoID, int tracerIndex);
    API_COMMANDMANAGER void polarCoordinateGraphRemoveSelectedTracer(int windowId, char* sinfoIdList, int curveInfoID);
    API_COMMANDMANAGER void polarCoordinateGraphRemoveAllTracer(int windowId, char* sinfoIdList);
    API_COMMANDMANAGER void polarCoordinateGraphExportMarkerData(int windowId, char* fileName);
    API_COMMANDMANAGER void polarCoordinateGraphChangeTracerProperty(int windowId, char* name, double x, int symbolStyle, int size, int penR, int penG, int penB, int penA, int tracerID);

    // 三维曲面图
    API_COMMANDMANAGER void createThreeDSurfacePlot(int graphType, int variableIndex, int frequencyIndex, int readerIndex, char* filePath, char* name, char* geometryFileName, bool isOpenNewWindow);
    API_COMMANDMANAGER void threeDSurfacePlotSidebarCurveNameClicked(int windowId, char* selectedIndexes);
    API_COMMANDMANAGER void threeDSurfacePlotSidebarFrequencyChanged(int windowId, int frequencyId);
    API_COMMANDMANAGER void threeDSurfacePlotSidebarResultDataChanged(int windowId, int resultDataIndex);
    API_COMMANDMANAGER void threeDSurfacePlotSidebarDataOprationChanged(int windowId, bool isLoged, bool isNormalized);
    API_COMMANDMANAGER void threeDSurfacePlotSidebarCurveNameItemCheckStateChanged(int windowId, int itemIndex, bool checkState);
    API_COMMANDMANAGER void saveThreeDSurfacePlotMainSettingData(int windowId, int settingDataId, bool scalarBarIsAutoRange, double scalarBarMin, double scalarBarMax,
                                                                 bool scalarBarIsShowTitle, char* scalarBarTitle, char* scalarBarFontColor, int scalarBarFontSize, int geometryTransparency, char* resultGraphName,
                                                                 int resultGraphModelTransparency, double resultGraphScale, bool cubeAxesIsVisible);
    API_COMMANDMANAGER void saveThreeDSurfacePlotMoveResultDataSetting(int windowId, int infomationId, double translationX, double translationY, double translationZ,
                                                                       double rotationTheta, double rotationPhi);
    API_COMMANDMANAGER void delete3DSurfacePlots(int windowId, char* selectedIndexs);
    API_COMMANDMANAGER void threeDSurfaceCurveNameItemRename(int windowId, int itemIndex, char* newName);
    API_COMMANDMANAGER void threeDSurfaceCurveDataFileterRadioButtonClicked(int windowId, int index);

    // 三维云图
    API_COMMANDMANAGER void createThreeDCloudMap(bool useNewWindow, int graphType, int variableIndex, int readerIndex, char* filePath, char* name, char* geometryFileName, int resultDataIndex);
    API_COMMANDMANAGER void threeDCloudMapSidebarCurveNameClicked(int windowId, char* selectedIndexes);
    API_COMMANDMANAGER void threeDCloudMapSidebarItemCheckStateChanged(int windowId, int index, bool visible);
    API_COMMANDMANAGER void threeDCloudMapSidebarDataOprationChanged(int windowId, bool isLoged, bool isNormalized);
    API_COMMANDMANAGER void threeDCloudMapSidebarUpdateFixedParameter(int windowId, int index);
    API_COMMANDMANAGER void threeDCloudMapSidebarUpdateOriginalDataSource(int mainWindowId, int index, int showType, int fixedValueIndex, bool isLog, bool isNormalize);
    API_COMMANDMANAGER void threeDCloudMapSidebarResultDataChanged(int windowId, int index);
    API_COMMANDMANAGER void threeDCloudMapSidebarNameItemRename(int windowId, int itemIndex, char* newName);
    API_COMMANDMANAGER void threeDCloudMapSidebarDelete3DCloudMap(int windowId, char* selectedIndexs);
    API_COMMANDMANAGER void saveThreeDCloudMapMainSettingData(int windowId, int type, int settingDataId,
                                                              bool scalarBarIsAutoRange, double scalarBarMin, double scalarBarMax,
                                                              bool scalarBarIsShowTitle, char* scalarBarTitle, char* scalarBarFontColor, int scalarBarFontSize,
                                                              int geometryTransparency, char* resultGraphName, int resultGraphModelTransparency, bool cubeAxesIsVisible);

    // 表面电场图
    API_COMMANDMANAGER void createSurfaceElectricFieldGraph(int graphType, int currentIndex, int readerIndex, char* sReaderType, char* sFilePath, char* sName, char* geometryFileName, bool isOpenNewWindow);
    API_COMMANDMANAGER void surfaceElectricFieldMapSidebarCurveNameClicked(int windowId, char* selectedIndexes);
    API_COMMANDMANAGER void surfaceElectricFieldMapSidebarItemCheckStateChanged(int windowId, int index, bool visible);
    API_COMMANDMANAGER void surfaceElectricFieldMapSidebarResultDataChanged(int windowId, int index);
    API_COMMANDMANAGER void surfaceElectricFieldMapSidebarUpdateProcessData(int windowId, bool isLog, bool isNormalize);
    API_COMMANDMANAGER void surfaceElectricFieldMapSidebarNameItemRename(int windowId, int itemIndex, char* newName);
    API_COMMANDMANAGER void surfaceElectricFieldMapSidebarDeleteSurfaceElectricFieldMap(int windowId, char* selectedIndexs);
    API_COMMANDMANAGER void saveSurfaceElectricFieldMapMainSettingData(int windowId, int type, int settingDataId,
                                                                       bool scalarBarIsAutoRange, double scalarBarMin, double scalarBarMax,
                                                                       bool scalarBarIsShowTitle, char* scalarBarTitle, char* scalarBarFontColor, int scalarBarFontSize,
                                                                       int geometryTransparency, char* resultGraphName, int resultGraphModelTransparency, bool cubeAxesIsVisible);

    //三维图标记
    
    API_COMMANDMANAGER void savePostMarkerAddSettingData(int windowUniversalID, int infomationGraph3DBasicalId, int type,
                                                         int fieldIndex, char* fieldName, int pickedId, char* pickedValue); 
    API_COMMANDMANAGER void savePostMarkerRemoveChosenSettingData(int windowUniversalID, char* removeChosenId);
    API_COMMANDMANAGER void savePostMarkerRemoveAllSettingData(int windowUniversalID);
    API_COMMANDMANAGER void savePostMarkerExportTableData(int windowUniversalID, char* fileName);

    //模型显示
    API_COMMANDMANAGER void saveModelDisplaySettingData(int windowUniversalID, bool toolButtonActiveClipperIsChecked, bool toolButtonModelDisplayIsChecked, bool hasAnyGeometrySuccess);
    API_COMMANDMANAGER void saveActiveClipperSettingData(int windowUniversalID, bool toolButtonActiveClipperIsChecked, bool toolButtonModelDisplayIsChecked, bool hasAnyGeometrySuccess, char* direction, double clipperValue);

    // 表格数据
    API_COMMANDMANAGER void createTableWidget(int readerIndex);
    API_COMMANDMANAGER void hideOrShowTableColumn(int windowId, char* selectedIndexs);
    API_COMMANDMANAGER void changeTbColumnName(int windowId, int index, char* newName);
    API_COMMANDMANAGER void flushTbBySelectedRow(int windowId, char* parms);
    API_COMMANDMANAGER void exportTbData(int windowId, char *filePath, char *delimiter, int onlyVisible);
    API_COMMANDMANAGER void highlightSelectedTbColumns(int windowId, char* parms);
    API_COMMANDMANAGER void doPrjCloseTree(int index);
    API_COMMANDMANAGER void doPrjTreeCopyDir(int index);
    API_COMMANDMANAGER void doPrjTreePasteDir(int srcId, int destId);
    API_COMMANDMANAGER void doPrjTreeCopyData(int index);
    API_COMMANDMANAGER void doPrjTreePasteData(int srcId, int destId);
    API_COMMANDMANAGER void doPrjTreeExpandDir(int index);
    API_COMMANDMANAGER void doPrjTreeCollapseDir(int index);
    API_COMMANDMANAGER void closeCenterTableBar(int index);
    API_COMMANDMANAGER void changeCurrentTabBar(int index);
    API_COMMANDMANAGER void submitEvaluation(int windowId, int emulationType, char* parms);

    API_COMMANDMANAGER void openProject();
    API_COMMANDMANAGER void exportData(char* filePath);
    API_COMMANDMANAGER void importProjectData(char* data);

    
    API_COMMANDMANAGER void lineChartWindowSetIsEdit(bool state);
    API_COMMANDMANAGER void lineChartChangeLineProperty(int windowUniversalID, int curveInfoID, char* docStr);
    API_COMMANDMANAGER void centerWidgetTabWidgetCurrentChanged(int currentIndex);
    API_COMMANDMANAGER void lineChartCurve2DPlotorGuideLineSelectRemove();
    API_COMMANDMANAGER void lineChartCurve2DPlotorGuideLineAllRemove();
    API_COMMANDMANAGER void lineChartCurve2DPlotorMarkerSelectRemove();
    API_COMMANDMANAGER void lineChartCurve2DPlotorMarkerAllRemove();
    API_COMMANDMANAGER void lineChartLineChartTracerSelectChange(int id, bool selected);
    API_COMMANDMANAGER void lineChartLineChartStraightLineSelectChange(int id, bool selected);
    API_COMMANDMANAGER void lineChartWindowChangeGuideLineProperty(int guideLineID, double value, int guideLineStyle, double guideLineThickness, char* guideLineColor);
    API_COMMANDMANAGER void lineChartWindowChangeTracerProperty(int tracerID, char* tracerName, double x, int symbolStyle, double symbolSize, char* symbolColor);
    API_COMMANDMANAGER void lineChartAxisLineUpdate(char* typeAxis, int id, double value);
    API_COMMANDMANAGER void lineChartComputeHIRF(char* graphNames, double incidentWaveFieldValue, char* HIRFName, char* typeName, bool isCheckBoxChecked);
    API_COMMANDMANAGER void lineChartSidebarSettingsRemoveSelectedGraph();
    API_COMMANDMANAGER void lineChartSidebarSettingsDeleteAllCurve();
    API_COMMANDMANAGER void lineChartCreateLineChartStraightLine(int typeAxis);
    API_COMMANDMANAGER void lineChartMeasureButtonClicked(int meaureTypeInt, double value);
    API_COMMANDMANAGER void lineChartSidebarSettingsRenameCheck(char* text);
    API_COMMANDMANAGER void lineChartCenterWidgetMoveLegend(int dataInt);
    API_COMMANDMANAGER void lineChartWindowAddTracer(int windowUniversalID, char* parameters);
    API_COMMANDMANAGER void lineChartCenterWidgetDialogAddLocalRange(double rangeLower, double rangeUpper, char* selectNames, bool execFlag, bool edit);
    API_COMMANDMANAGER void lineChartDialogCurveSmoothing(double range);
    API_COMMANDMANAGER void lineChartCurve2DPlotorRemoveSelectedGraph();
    API_COMMANDMANAGER void lineChartCurve2DPlotorRemoveAllGraphs();
    API_COMMANDMANAGER void lineChartDialogWaveformAnalysis(char* graphName, double cutOffFrequency, char* filterType, int filterOrder, char* leftBoundary, char* rightBoundary, int windowId, char* resultList);
    API_COMMANDMANAGER void lineChartDialogIPLCalculation(char* IPLString);
    API_COMMANDMANAGER void lineChartDialogTransferFunction(char* graphName, char* calibrationGraphName, char* type);
    API_COMMANDMANAGER void lineChartCenterWidgetInfoListPaste(char* infoIds);
    API_COMMANDMANAGER void lineChartSidebarSettingsAllVariableAxisSet(char* data);
    API_COMMANDMANAGER void lineChartSidebarSettingsComplex(char* data);
    API_COMMANDMANAGER void lineChartSidebarSettingsFormulaEditor(char* data);
    API_COMMANDMANAGER void lineChartSidebarSettingsCopySelectedGraph();
    API_COMMANDMANAGER void lineChartComputeEffectiveness(char* graphNames, double e0);
    API_COMMANDMANAGER void lineChartDialogInterpolation(int number, int type);
    
    // 工程数据
    API_COMMANDMANAGER void doPrjFileWrite(char* fileName);
    API_COMMANDMANAGER void doPrjFileRead(char* fileName);

    //波形分析計算
    API_COMMANDMANAGER void sentWaveButterANdFFTVResult(int windowId, char* resultList);
    
    //保存gif
    API_COMMANDMANAGER void saveGifSuccess(bool suc);

}

#endif
